﻿using System;

namespace enyo
{
    public class Control : ContainedDomBuilder
    {
        #region Non-enyo standard, but must have.
        public ControlKind Kind;
        public ushort Flex;
        public string Style;
        public Pack Pack;
        public Align Align;
        public bool Disabled;

        /// <summary>
        /// number with px, such as 320px
        /// </summary>
        public string Width;
        /// <summary>
        /// number with px, such as 320px
        /// </summary>
        public string Height;
        #endregion

        public FlexLayout LayoutKind { get; set; }
        public EnyoEvent<Control> onclick;
        public EnyoEvent<Control> onmousedown;
        public EnyoEvent<Control> onmouseup;

        /// <summary>
        /// Send a message to me and all my controls
        /// </summary>
        /// <param name="messageName"></param>
        /// <param name="args"></param>
        public void BroadcastMessage(string messageName, /*TODO:Type*/object args)
        {
        }

        /// <summary>
        /// Destroys 'managed controls', the same set of controls returned by getControls.
        /// </summary>
        public void DestroyControls()
        {
        }

        /// <summary>
        /// Returns the 'non-private managed controls', which is not actually the same as the 'controls' array (note: this is a problem of taxonomy).
        /// </summary>
        /// <returns></returns>
        public Control[] GetControls()
        {
            return null;
        }

        /// <summary>
        /// Returns the index of a given managed control in a component's list of controls. 
        /// Current implementation returns index in this.controls, but index in this.getControls() makes more sense.
        /// </summary>
        /// <param name="ctrl"></param>
        /// <returns></returns>
        public int IndexOfControl(Control ctrl)
        {
            return 0;
        }

        /// <summary>
        /// Call after this control has been resized to allow it to process the size change. 
        /// Implement a "resizeHandler" method to respond to being resized.
        /// </summary>
        public void Resized()
        {
        }
    }
}
